<?php
echo $session->flash('auth');
echo $form->create('Account',
        array(
            'action' => 'validateLogin',
            'id' => 'account',
            'default' => false));
echo $form->input('email', array('id' => 'email'));
echo $form->input('password', array('id' => 'password'));
echo $form->end();
?>
<div id="accounts-login-result" class="input">hello!</div>

<script type="text/javascript">
    var delayedActionId = 0;
    action = function() {
        new Form.Request($('account'), $('accounts-login-result'), {resetForm:false}).send();
    };
    delayedAction = function() {
        clearTimeout(delayedActionId);
        delayedActionId = action.delay(300);
    }
    $('email').addEvent('keyup', delayedAction);
    $('password').addEvent('keyup', delayedAction);
</script>
